# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Krassy Boykinov <kboykinov@teamcentrixx.com>
pkgname=libpeas2
pkgver=2.0.0
pkgrel=0
pkgdesc="GObject-based plugin system"
url="https://wiki.gnome.org/Projects/Libpeas"
# armhf and s390x blocked by gjs-dev -> mozjs
arch="all !armhf !s390x"
case "$CARCH" in
	armv7) options="$options !check"
esac
license="LGPL-2.1-or-later"
makedepends="
	gjs-dev
	glib-dev
	gobject-introspection-dev
	gtk+3.0-dev
	meson
	py3-gobject3-dev
	python3-dev
	vala
	"
checkdepends="dbus bash py3-gobject3 xvfb-run gobject-introspection"
subpackages="$pkgname-dev $pkgname-python3:py3 $pkgname-lang"
source="https://download.gnome.org/sources/libpeas/${pkgver%.*}/libpeas-$pkgver.tar.xz"
builddir="$srcdir/libpeas-$pkgver"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dlua51=false \
		-Dvapi=true \
		. output
	meson compile -C output
}

check() {
	xvfb-run -a meson test --print-errorlogs -C output -t 10
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

py3() {
	depends="py3-gobject3"

	amove usr/lib/libpeas-2/loaders/libpythonloader.*
}

sha512sums="
08a9ad330f6878667126dd655241900a84abadff43f635c4034439a935331b0afd3df368325ba7014594b141c053a11b02f81d4f0462cd7aba348250554d43d9  libpeas-2.0.0.tar.xz
"
